<template>
  <view class="inforamtion" style="display: flex;">
  	<view >
  		<view class="option" style="width: 520rpx;">
  			<view class="lf">含税金额(元)</view>
  			<view class="rl">{{ item.amount }}</view>
  		</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">税率(%)</view>
				<view class="rl"> {{ item.taxRate_dictText }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">税额(元)</view>
				<view class="rl"> {{ item.taxation }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">未税金额(元)</view>
				<view class="rl"> {{ item.untaxedAmount }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">备注</view>
				<view class="rl"> {{ item.remark }}</view>
			</view>
  	</view>
  	<view  style="flex: 1; display: flex; align-items: center; justify-content: flex-end;" v-if="!disabled">
  		<u-icon name="edit-pen-fill" color="#2979ff" size="20" @click="handleEidtForm(item)"></u-icon>
  	</view>
  </view>
</template>

<script>
export default {
  name: 'FormRateInfo',
  props: {
    index: {
      type: Number,
      default: null,
    },
    item: {
      type: Object,
      default: () => ({}),
    },
		disabled: {
			type: Boolean,
			default: false,
		}
  },
  data () {
    return {
    }
  },
  methods: {
    handleCopyForm(item) {
      this.$emit('copy', [item, this.index])
    },
    handleEidtForm(item) {
      this.$emit('edit', [item, this.index])
    },
    handleRemoveForm(item) {
      uni.showModal({
        content: '确定删除吗？',
        success: (res) => {
          if (res.confirm) {
            this.$emit('remove', item)
          }
        },
      })
    },
  },
}
</script>

<style scoped lang="scss">
	.inforamtion{
		margin-top: 10rpx;
		padding: 10rpx;
		border-radius: 15rpx;
		box-shadow: 0px 4px 20px 0px rgba(0,0,0,0.1);
	}
</style>
